/*
 * @Author       : xiangmin
 * @File         : 监听modal显示隐藏的hooks
 * @Date         : 2024-05-29 15:05:31
 * @LastEditors  : xiangmin
 * @LastEditTime : 2024-09-06 15:31:01
 */

import type { Ref } from 'vue'

type Options = {
	open?: () => void
	close?: () => void
}
export default function (visible: Ref<boolean>, options?: Options) {
	watch(visible, value => {
		value ? options?.open?.() : options?.close?.()
	})
}
